package com.toman.JavaBean;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Objects;

/**
 * 用户信息Dto，相比较SysUserEntity去除一此敏感信息
 *
 * @Author: John
 * @Date: 2018/6/14 13:36
 * @Description:
 */
@AllArgsConstructor
@NoArgsConstructor
@Data
public class SysUserBo implements Serializable {
    /**
     * 用户ID
     */
    private Long userId;
    /**
     * 用户登录名
     */
    private String username;
    /**
     * 用户真实姓名
     */
    private String realName;

    @Override
    public boolean equals(Object object) {
        if (this == object) {
            return true;
        }
        if (object == null || getClass() != object.getClass()) {
            return false;
        }
        SysUserBo sysUserBo = (SysUserBo) object;
        return Objects.equals(userId, sysUserBo.userId);
    }

    @Override
    public int hashCode() {
        return Objects.hash(userId);
    }
}
